<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>文章 - 博客管理系统</title>
    <link rel="stylesheet" type="text/css" href="/admin/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/admin/css/style.css">
    <link rel="stylesheet" type="text/css" href="/admin/css/font-awesome.min.css">
    <link rel="apple-touch-icon-precomposed" href="/admin/images/icon/icon.png">
    <link rel="shortcut icon" href="/admin/images/icon/favicon.ico">
    <script src="/admin/js/jquery-2.1.4.min.js"></script>
    <script src="/layer/layer.js"></script>
    <script type="text/javascript">
        function deleteUser(userId) {
            layer.confirm('是否删除用户？',
                {
                    btn:['是','否'],//按钮
                    icon:2   //图标
                },
                function () {
                    layer.msg('删除信息');
                    location.href = "/back/user/delete?userId=" + userId;
                }
            )
        }
        
    </script>

</head>
<body class="user-select" style="margin: 0px;padding: 0px;">
<div>
    <ul class="breadcrumb" style="margin: 0px;">
        <li>用户管理</li>
        <li>用户查询</li>
    </ul>
</div>
<form action="/back/user/list" method="post"  class="form-inline">
    <input type="hidden" name="page" value="1"/>
    <div class="row alert alert-info">
        <div class="form-group">
            <input type="text" name="userName" class="form-control" placeholder="请输入姓名" value="${(userinfo.userName)!}"/>
            <input type="submit" value="查询" class="btn btn-info "/>
            <a href="/back/user/add" class="btn btn-info">
                添加用户</a>

        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <div style="color:red;" align="center">${(info)!}</div>
            <tr>
                <th>用户编号</th>
                <th>姓名姓名</th>
                <th>电话号码</th>
                <th>用户账号</th>
                <th>用户密码</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#list (pageBean.list)! as user>
            <tr>
                <td>${(user.userId)!}</td>
                <td >${(user.userName)!}</td>
                <td>${(user.userPhone)!}</td>
                <td>${(user.userAccount)!}</td>
                <td>${(user.userPassword)!}</td>
                <td><a href="/back/user/update?userId=${user.userId}">修改</a>
<!--
                    <a  href="/back/user/delete?userId=${user.userId}"  rel="6">删除</a>
-->
                    <a  href="javascript:void(0)" onclick="deleteUser(${user.userId})" rel="6">删除</a>
                </td>
            </tr>
            </#list>
            </tbody>
        </table>
        共有${pageBean.allRow}条记录，当前是第${pageBean.currentPage}/${pageBean.totalPage}页
        <nav >
            <ul class="pager">
                <#if pageBean.currentPage == 1>
                第一页 上一页

                <#else>
                <li><a href="/back/user/list?page=1&userName=${(userInfo.userName)!}">第一页</a></li>
                <li><a href="/back/user/list?page=${pageBean.currentPage-1}&userName=${(userInfo.userName)!}">上一页</a></li>
            </#if>
            <#if pageBean.currentPage == pageBean.totalPage>
            下一页 最末页
            <#else>
            <li><a href="/back/user/list?page=${pageBean.currentPage+1}&userName=${(userInfo.userName)!}">下一页</a></li>
            <li><a href="/back/user/list?page=${pageBean.totalPage}&userName=${(userInfo.userName)!}">最末页</a></li>
        </#if>
        </ul>
        </nav>
    </div>

</form>
<script src="/admin/js/bootstrap.min.js"></script>
<script src="/admin/js/admin-scripts.js"></script>
</body>
</html>
